<h:outputScript
 xmlns="http://www.w3.org/1999/xhtml"
 xmlns:h="http://java.sun.com/jsf/html"
 target="#{pageJsTarget}">
  var nuxeo = (function(nuxeo) {
    nuxeo.doubleClickShield = {
      message: "#{messages['doubleClick_shield.already.submitting']}"
    };
    return nuxeo;
  })(nuxeo || {});

  jQuery(document).ready(function() {
    jQuery('form.doubleClickShielded').each(function() {
      jQuery(this).preventDoubleSubmission();
    });
  });
  jsf.ajax.addOnEvent(function(data) {
    var ajaxstatus = data.status;
    if (ajaxstatus == "success") {
      jQuery('form.doubleClickShielded').each(function() {
        jQuery(this).preventDoubleSubmission();
      });
    }
  });
</h:outputScript>